package com.ashun.service.impl;

import com.ashun.dao.DictTypeRepository;
import com.ashun.entity.DictType;
import com.ashun.service.IDictTypeService;
import com.google.common.base.Preconditions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by xufeifei on 16/10/14.
 */
@Service
@Transactional
@Repository("dictTypeService")
public class DictTypeService implements IDictTypeService {

    @Autowired
    private DictTypeRepository dictTypeRepository;

    public Page<DictType> findDictTypePage(Pageable page) {
        Preconditions.checkNotNull(page,"page can't be null!");
        return dictTypeRepository.findAll(page);
    }
}
